<div class='fui-page-group' ng-if="pagedata.op == 'get'">
<div class='fui-page  fui-page-current'>
	<div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">员工中心</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content member-page navbar'>
		<div class="fui-list-group merchgroup">
			<div class="fui-list jump">
                <a class="fui-list-media">
                    <img class="round" src="{{tomedia(pagedata.myinfo.logo) || '../core/resource/images/nopic.jpg'}}" />
                </a>
                <div class="fui-list-inner">
                    <div class="title">{{pagedata.myinfo.name || '匿名用户'}}</div>
					<div class="title" style="font-size:0.65rem">积分：{{pagedata.myjifen || '0.00'}}</div>
                </div>
                <a class="jump" href="javascript:;" ng-click="access_json('jy_workline/worker_home/set')">
					<i class="icon jinyunicon icon-set" style="width: 2rem; text-align: center;"></i>
				</a>
            </div>
		</div>
		<div class="weui_cells_title" style="background-color: #fff;"><i class="icon jinyunicon icon-dianpu" style="font-size:0.76rem"></i>我的工作台</div>
		<div class="fui-icon-group noborder col-2" style="background-color: #fff;">
						<div class="fui-icon-col external" href="javascript:;" ng-click="access_json('jy_workline/tcpmanage/list/')">
							<div class="badge"></div>
							<div class="icon icon-green radius"><i class="icon jinyunicon icon-caifua"></i></div>
							<div class="text">我的任务</div>
						</div>
						<div class="fui-icon-col external"  href="javascript:;" ng-click="access_json('jy_workline/tcpmanage/mylist/')">
							<div class="badge"></div>
							<div class="icon icon-green radius"><i class="icon jinyunicon icon-quanbudingdan"></i></div>
							<div class="text">我发布的</div>
						</div>
						<div class="fui-icon-col external" href="javascript:;" ng-click="access_json('jy_workline/tcpmanage/get/')">
							<div class="badge"></div>
							<div class="icon icon-green radius"><i class="icon jinyunicon icon-caifua"></i></div>
							<div class="text">我要领取</div>
						</div>
						<div class="fui-icon-col external" href="javascript:;" ng-click="access_json('jy_workline/tcpmanage/edit/')">
							<div class="badge"></div>
							<div class="icon icon-green radius"><i class="icon jinyunicon icon-quanbudingdan"></i></div>
							<div class="text">我要发布</div>
						</div>
		</div>
		<div class="col-jy-12" style="padding:0.5rem;">
					<div class="ibox float-e-margins">
						<div class="ibox-title"><h4>今日/总任务积分指标</h4></div>
						<div class="panel-stat" style="background-color: #ffffff;border-color: #e7eaec;border-style: solid solid none;border-width: 1px 0px;">
							<div class="panel-stat-btn row" style="padding:0.5rem;">
								<div class="col-sm-{{pagedata.workers.num}} text-center" ng-repeat="data in pagedata.workers.datas">{{data.title}}
									<div>
										<span class="today ">{{data.data[0]}}</span>
										<span class="pipe">/</span>
										<span class="yesterday ">{{data.data[1]}}</span>
									</div>
								</div>
							</div>
						</div>
					</div>
		</div>

		<div class="col-jy-12" style="padding:0.5rem;">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>员工任务完成数量</h5>
					</div>
					<div class="ibox-content">
						<div class="echarts" id="echarts-chart-workernum" style="height: 310px;display: none;"></div>
						<div class="spiner-example" id="echarts-loading-workernum">
								<div class="sk-spinner sk-spinner-three-bounce">
									<div class="sk-bounce1"></div>
									<div class="sk-bounce2"></div>
									<div class="sk-bounce3"></div>
								</div>
						</div>
					</div>
				</div>
		</div>
		<div class="col-jy-12" style="padding:0.5rem;">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5>员工任务获取积分</h5>
					</div>
					<div class="ibox-content">
						<div class="echarts" id="echarts-chart-workersjifen" style="height: 310px;display: none;"></div>
						<div class="spiner-example" id="echarts-loading-workersjifen">
								<div class="sk-spinner sk-spinner-three-bounce">
									<div class="sk-bounce1"></div>
									<div class="sk-bounce2"></div>
									<div class="sk-bounce3"></div>
								</div>
						</div>
					</div>
				</div>
		</div>
	</div>
</div>
</div>
<div ng-if="pagedata.op == 'set'">
<div class="fui-header">
		<div class="fui-header-left" onclick="window.history.go(-1);">
            <a class="back"></a>
        </div>
		<div class="title">个人设置</div>
		<div class="fui-header-right"></div>
</div>
<div class="fui-list-group merchgroup" style="margin-top:58px">
				<div class="fui-list jump">
					<a class="fui-list-media" ng-if="pagedata.worker.logo">
						<img class="round" src="{{tomedia(pagedata.worker.logo) || '../core/resource/images/nopic.jpg'}}" />
					</a>
					<a class="fui-list-media weui_uploader_input_wrp" ng-if="!pagedata.worker.logo" >
						<input class="weui_uploader_input" ng-click="up_file(pagedata.worker,'logo','image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
					</a>
				</div>
</div>
<div class="weui_cells weui_cells_form">
	<div class="weui_cell weui_vcode">
         <div class="weui_cell_hd"><label class="weui_label">姓名</label></div>
         <div class="weui_cell_bd weui_cell_primary">
              <input class="weui_input" type="text" ng-model="pagedata.worker.name" placeholder="请输入您的真实姓名">
         </div>
    </div>
</div>
<div class="weui_btn_area">
	<a class="weui_btn weui_btn_primary" href="javascript:"  ng-click="post(pagedata.worker,'set')">提交</a>
</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script type="text/javascript">
require(['echarts'],
function () {
  var created = function () {// 钩子  
	   var res = scope.pagedata.workers;
	   var res2 = scope.pagedata.workersjifen;
	   if(res){
		   $("#echarts-loading-workernum").hide()
		   $("#echarts-chart-workernum").show();
		   $("#echarts-loading-workersjifen").hide()
		   $("#echarts-chart-workersjifen").show();
			pie_chart_workernum(res);
			pie_chart_workersjifen(res2);
	   }
  }
   created();  
}); 
function pie_chart_workernum(res){
	var l = echarts.init(document.getElementById("echarts-chart-workernum"));
	var legend=[];
	$.each(res.datas,function(k,v){
		legend.push(v.name);
	});
		var u = {
				title: {
					//text: '',
					//subtext: '',
					x: "center"
				},
				tooltip: {
					trigger: "item",
					formatter: "{a} <br/>{b} : {c} ({d}%)"
				},
				legend: {
					orient: "vertical",
					x: "left",
					data: legend
				},
				calculable: !0,
				series: [{
					name: '员工任务完成数量',
					type: "pie",
					radius: "55%",
					center: ["50%", "60%"],
					data: res.datas
				}]
			};
		l.setOption(u), $(window).resize(l.resize);
}
function pie_chart_workersjifen(res){
	var l = echarts.init(document.getElementById("echarts-chart-workersjifen"));
	var legend=[];
	$.each(res.datas,function(k,v){
		legend.push(v.name);
	});
		var u = {
				title: {
					//text: '',
					//subtext: '',
					x: "center"
				},
				tooltip: {
					trigger: "item",
					formatter: "{a} <br/>{b} : {c} ({d}%)"
				},
				legend: {
					orient: "vertical",
					x: "left",
					data: legend
				},
				calculable: !0,
				series: [{
					name: '员工任务获取积分',
					type: "pie",
					radius: "55%",
					center: ["50%", "60%"],
					data: res.datas
				}]
			};
		l.setOption(u), $(window).resize(l.resize);
}
</script>